﻿using System;
using System.Collections;

namespace Ooganizer.Resolver
{
    /// <summary>
    /// Name = contains the Title of the Artifact
    /// Location = is the complete file path
    /// </summary>
    public class Artifact
    {
        public string Name;
        public string Location;
    }

    /// <summary>
    /// ArtifactGroup uses an ArrayList to allow us to add multiple Artifacts as
    /// part of a group (the primary artifact is the one that should be used first)
    /// </summary>
    public class ArtifactGroup
    {
        private ArrayList m_Artifacts;
        public ArtifactGroup(){m_Artifacts = new ArrayList();}
        public int Length{get{return m_Artifacts.Count;}}
        public void Add(Artifact artifact){m_Artifacts.Add(artifact);}
        public void AddPrimary(Artifact artifact){m_Artifacts.Insert(0, artifact);}
        public Artifact GetAt(int nIndex) {return (Artifact)m_Artifacts[nIndex];}
        public Artifact GetPrimary { get { return (Artifact)m_Artifacts[0]; } }
    }

    // Interface that must be implemented in all Child Resolvers
    public interface IResolver
    {
        ArtifactGroup GetArtifacts(IntPtr hWnd);
    }
}
